package com.bdqn.service.impl;

import com.bdqn.mapper.SysRegisteredItemMapper;
import com.bdqn.pojo.SysRegisteredItem;
import com.bdqn.service.SysRegisteredItemService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysRegisteredItemServiceImpl implements SysRegisteredItemService {
    @Autowired
    SysRegisteredItemMapper sysRegisteredItemMapper;
    public PageInfo<SysRegisteredItem> page(int pageNum, int pageSize,String regItemName, String status){
        PageHelper.startPage(pageNum,pageSize);
        List<SysRegisteredItem> list=sysRegisteredItemMapper.selectAll(regItemName,status);
        PageInfo<SysRegisteredItem> pageInfo=new PageInfo<>(list);
        return pageInfo;
    }
    public int update(SysRegisteredItem sysRegisteredItem){
        int i=sysRegisteredItemMapper.update(sysRegisteredItem);
        return i;
    }
    public int insert(SysRegisteredItem sysRegisteredItem){
        int i=sysRegisteredItemMapper.insert(sysRegisteredItem);
        return i;
    }
}
